<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../../../common/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<sfa:mainTitle></sfa:mainTitle>
		<%@ include file="../../../common/meta.jsp"%>
		<script type="text/javascript">
function doQuery() {
	$("#aid").html('');
	document.form1.action = "${path}/team/recom/index/agentteamlist?optype=recom&dotype=${dotype}";
	document.form1.submit();
}
function gotopolicycount(obj) {
	window.location.href = "${path}/team/recom/index/policycount?aid=" + obj
			+ "&sdate=" + $("#sdate").val() + "&edate=" + $("#edate").val();
}
$(function() {
	//fixTable.FixTable("mytable");
	$("#fullScreen").click(function() {
		fullScreen.FullScreen("maindiv");
	});
})
</script>
	</head>
	<body id="master">
		<sfa:mainHeader></sfa:mainHeader>
		<form action="" name="form1" method="post">

			<div class="webpart3 contentarea">
				<div class="webpart-head">
					<div class="webpart-head-item">
						推荐统计信息
						<div class="tools-btn">
							<a href="javascript:" id="fullScreen"><span> <img
										src="${path}/statics/images/qp.gif"
										style="margin-right: 4px; margin-bottom: -3px;" />全屏</span> </a>
						</div>
					</div>
				</div>
				<div class="webpart-main" id="maindiv">
					<div class="webpart-main-item" style="padding-top: 12px;">
						<div class="search">
							<table width="100%" border="0" cellspacing="0" cellpadding="10"
								class="table_form">
								<tr>
									<td>
										<span>姓名：</span>
										<input type="text" class="input-txt" id="agentname"
											name="agentname" value="${agentname}" />
									</td>
									<td>
										<span>
											职级：
										</span>
										<select name="agentlevelcode" id="agentlevelcode" class="savehistory"> 
												<option value="ALL"  >未选择</option>
												<option value="SL" ${agentlevelcode=='SL'?'selected':''}>SL-行销主任</option>
												<option value="SM" ${agentlevelcode=='SM'?'selected':''}>SM-行销经理</option>
												<option value="SD" ${agentlevelcode=='SD'?'selected':''}>SD-行销总监</option>
												<option value="NAC1" ${agentlevelcode=='NAC1'?'selected':''}>NAC1-理财顾问</option>
												<option value="NAC2" ${agentlevelcode=='NAC2'?'selected':''}>NAC2-资深顾问</option>
												<option value="AM" ${agentlevelcode=='AM'?'selected':''}>AM-业务经理</option>
												<option value="UM" ${agentlevelcode=='UM'?'selected':''}>UM-高级经理</option>
												<option value="OM1" ${agentlevelcode=='OM1'?'selected':''}>OM1-业务总监</option>
												<option value="OM2" ${agentlevelcode=='OM2'?'selected':''}>OM2-区域总监</option> 
										</select>
									</td>
									<td>
										<c:if test="${dotype=='team'}">
											<span>显示方式：</span>
											<select id="levelby" name="levelby">
												<option value="0" ${levelby=='0'?'selected':''}>
													全部展开
												</option>
												<option value="1" ${levelby=='1'?'selected':''}>
													层级显示
												</option>
											</select>
										</c:if>
									</td>
								</tr>
								<tr>
									<td>
										<span>月份：</span>
										<input type="text" readonly="readonly" id="sdate" name="sdate"
											value="${sdate}" class="input-txt"
											onclick="WdatePicker({dateFmt:'yyyy-MM'})" />
										~
										<input type="text" readonly="readonly" id="edate" name="edate"
											value="${edate}" class="input-txt"
											onclick="WdatePicker({dateFmt:'yyyy-MM'})" />
									</td>
									<td align="right">
										<a href="javascript:" onclick="doQuery()" class="linkbtn"><span>查询</span>
										</a>

										<a href="javascript:" onclick="javascript: history.back();"
											class="linkbtn"><span>返 回</span> </a>
										<input type="hidden" id="aid" name="aid" value="${aid}">
									</td>
									<td></td>
								</tr>
							</table>
						</div>
						<c:if test="${levelby=='0'}">
							<table id="mytable" cellpadding="0" cellspacing="0"
								class="dg_borderstyle  trStyleTable"
								style="margin-top: 15px; text-align: center;">
								<tr>
									<th>
										<span>序号</span>
									</th>
									<th>
										<span>姓名</span>
									</th>
									<th>
										<span>职级</span>
									</th>
									<th>
										<span>
											${optype=='team'?"上级代理人":optype=='recom'?"推荐人":"育成人"} </span>
									</th>
									<th>
										<span>营业处</span>
									</th>
									<th>
										<span>是否持证</span>
									</th>
									<th align="right">
										<span>FYB</span>
									</th>
									<th align="right">
										<span>价保</span>
									</th>
									<th>
										<span>签约日期</span>
									</th>
									<c:if test="${dotype=='dismiss'}">
										<th>
											<span>解约日期</span>
										</th>
									</c:if>
								</tr>
								<c:forEach items="${pagination.resultList}" var="list">
									<tr>
										<td>
											<span>${list.ROWINDEX}</span>
										</td>
										<td>
											<span><a
												href="${path}/team/recom/index/agentinfo?id=${list.AGENTID}">
													${list.AGENTNAME}</a> </span>
										</td>
										<td>
											<span>${list.AGENTLEVEL}</span>
										</td>
										<td>
											<span>${list.UPAGENTNAME}</span>
										</td>
										<td>
											<span>${list.ABBRNAME}</span>
										</td>
										<td>
											<span> ${list.QUALIFICATIONNO=="N"?"否":"是"} </span>
										</td>
										<td align="right">
											<span><a onclick="gotopolicycount('${list.AGENTID}')"
												href="javascript:">${list.FYB}</a> </span>
										</td>
										<td align="right">
											<span>${list.VALUEPREM} </span>
										</td>
										<td>
											<span>${list.HIREDATE}</span>
										</td>
										<c:if test="${dotype=='dismiss'}">
											<td>
												<span>${list.DISMISSDATE}</span>
											</td>
										</c:if>
									</tr>
								</c:forEach>
							</table>
							<c:if test="${not empty pagination.multiPage}">
								<div class="dg_pagerstyle">
									<div class="pageinfo">
										第${pagination.page }页 | 共${pagination.totalPages
										}页/${pagination.totalRows }条记录
									</div>
									<div class="pagebtn">
										${pagination.multiPage}
									</div>
								</div>
							</c:if>
						</c:if>
						<c:if test="${levelby=='1'}">
							<div class="webpart-head">
								<div class="webpart-head-item">
									当前代理人
								</div>
							</div>
							<table cellpadding="0" cellspacing="0"
								class="dg_borderstyle  trStyleTable"
								style="margin-top: 0px; text-align: center;">
								<tr>
									<th>
										<span>序号</span>
									</th>
									<th>
										<span>姓名</span>
									</th>
									<th>
										<span>职级</span>
									</th>
									<th>
										<span>
											${optype=='team'?"上级代理人":optype=='recom'?"推荐人":"育成人"} </span>
									</th>
									<th>
										<span>营业处</span>
									</th>
									<th>
										<span>是否持证</span>
									</th>
									<th align="right">
										<span>FYB</span>
									</th>
									<th align="right">
										<span>价保</span>
									</th>
									<th>
										<span>签约日期</span>
									</th>
									<c:if test="${dotype=='dismiss'}">
										<th>
											<span>解约日期</span>
										</th>
									</c:if>
								</tr>
								<c:forEach items="${currentagent.resultList}" var="list">
									<tr>
										<td>
											<span>${list.ROWINDEX}</span>
										</td>
										<td>
											<span><a
												href="${path}/team/recom/index/agentinfo?dotype=${dotype}&id=${list.AGENTID}">
													${list.AGENTNAME}</a> </span>
										</td>
										<td>
											<span>${list.AGENTLEVEL}</span>
										</td>
										<td>
											<span>${list.UPAGENTNAME}</span>
										</td>
										<td>
											<span>${list.ABBRNAME}</span>
										</td>
										<td>
											<span>
												${list.QUALIFICATIONNO==""&&list.ROWINDEX!=""?"否":"是"} </span>
										</td>
										<td align="right">
											<span><a onclick="gotopolicycount('${list.AGENTID}')"
												href="#">${list.FYB}</a> </span> </td> <td
													align="right"><span >${list.VALUEPREM} 
											</span>
										</td>
										<td>
											<span>${list.HIREDATE}</span>
										</td>
										<c:if test="${dotype=='dismiss'}">
											<td>
												<span>${list.DISMISSDATE}</span>
											</td>
										</c:if>
									</tr>
								</c:forEach>
							</table>
							<br />
							<div class="webpart-head">
								<div class="webpart-head-item">
									${level_info }
								</div>
							</div>
							<table id="mytable" cellpadding="0" cellspacing="0"
								class="dg_borderstyle trStyleTable"
								style="margin-top: 0px; text-align: center;">
								<tr>
									<th>
										<span>序号</span>
									</th>
									<th>
										<span>姓名</span>
									</th>
									<th>
										<span>职级</span>
									</th>
									<th>
										<span>
											${optype=='team'?"上级代理人":optype=='recom'?"推荐人":"育成人"} </span>
									</th>
									<th>
										<span>营业处</span>
									</th>
									<th>
										<span>是否持证</span>
									</th>
									<th align="right">
										<span>FYB</span>
									</th>
									<th align="right">
										<span>价保</span>
									</th>
									<th>
										<span>签约日期</span>
									</th>
									<c:if test="${dotype=='dismiss'}">
										<th>
											<span>解约日期</span>
										</th>
									</c:if>
									<th>
										<span>${level_info }</span>
									</th>
								</tr>
								<c:forEach items="${pagination.resultList}" var="list">
									<tr>
										<td>
											<span>${list.ROWINDEX}</span>
										</td>
										<td>
											<span><a
												href="${path}/team/recom/index/agentinfo?dotype=${dotype}&id=${list.AGENTID}">
													${list.AGENTNAME}</a> </span>
										</td>
										<td>
											<span>${list.AGENTLEVEL}</span>
										</td>
										<td>
											<span>${list.UPAGENTNAME}</span>
										</td>
										<td>
											<span>${list.ABBRNAME}</span>
										</td>
										<td>
											<span>
												${list.QUALIFICATIONNO==""&&list.ROWINDEX!=""?"否":"是"} </span>
										</td>
										<td align="right">
											<span><a onclick="gotopolicycount('${list.AGENTID}')"
												href="#">${list.FYB}</a> </span> </td> <td
													align="right"> <span> ${list.VALUEPREM} 
											</span>
										</td>
										<td>
											<span>${list.HIREDATE}</span>
										</td>
										<c:if test="${dotype=='dismiss'}">
											<td>
												<span>${list.DISMISSDATE}</span>
											</td>
										</c:if>
										<td>
											<span><a
												href="${path}/team/recom/index/agentteamlist?dotype=${dotype}&optype=${optype}&levelby=1&aid=${list.AGENTID}">
													查看</a> </span>
										</td>
									</tr>
								</c:forEach>

							</table>
							<c:if test="${not empty pagination.multiPage}">
								<div class="dg_pagerstyle">
									<div class="pageinfo">
										第${pagination.page }页 | 共${pagination.totalPages
										}页/${pagination.totalRows }条记录
									</div>
									<div class="pagebtn">
										${pagination.multiPage}
									</div>
								</div>
							</c:if>
						</c:if>
					</div>
				</div>
				<div class="webpart-foot">
					<div class="webpart-foot-item">
					</div>
				</div>
			</div>
		</form>
		<sfa:mainFooter></sfa:mainFooter>
	</body>
</html>
